<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>韩城市综合行政执法局业务审批管理系统</title>
  <!-- Tell the browser to be responsive to screen width -->
  <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
  <!-- Bootstrap 3.3.7 -->
  <link rel="stylesheet" href="__ADMIN__/bower_components/bootstrap/dist/css/bootstrap.min.css">
  <!-- Font Awesome -->
  <link rel="stylesheet" href="__ADMIN__/bower_components/font-awesome/css/font-awesome.min.css">
  <!-- Ionicons -->
  <link rel="stylesheet" href="__ADMIN__/bower_components/Ionicons/css/ionicons.min.css">
  <!-- Theme style -->
  <link rel="stylesheet" href="__ADMIN__/dist/css/AdminLTE.min.css">
  <!-- AdminLTE Skins. Choose a skin from the css/skins
       folder instead of downloading all of them to reduce the load. -->
  <link rel="stylesheet" href="__ADMIN__/dist/css/skins/_all-skins.min.css">
  <!-- Morris chart -->
  <link rel="stylesheet" href="__ADMIN__/bower_components/morris.js/morris.css">
  <!-- jvectormap -->
  <link rel="stylesheet" href="__ADMIN__/bower_components/jvectormap/jquery-jvectormap.css">
  <!-- Date Picker -->
  <link rel="stylesheet" href="__ADMIN__/bower_components/bootstrap-datepicker/dist/css/bootstrap-datepicker.min.css">
  <!-- Daterange picker -->
  <link rel="stylesheet" href="__ADMIN__/bower_components/bootstrap-daterangepicker/daterangepicker.css">
  <!-- bootstrap wysihtml5 - text editor -->
  <link rel="stylesheet" href="__ADMIN__/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css">
  <!-- 自定义样式 -->
  <link rel="stylesheet" href="__ADMIN__/css/style.css">
  <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
  <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
  <!--[if lt IE 9]>
  <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
  <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
  <![endif]-->
  <!-- jQuery 3 -->
  <script src="__ADMIN__/bower_components/jquery/dist/jquery.min.js"></script>
  <script src="__PLUS__/layer/layer.js"></script>
</head>
<body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper">

  <!-- 头部 -->
  {include file="common/header"}
  <!-- //头部 -->

  <!-- 左侧导航 -->
  {include file="common/left"}
  <!-- /左侧导航 -->

  <!-- Content Wrapper. Contains page content -->
  <div class="content-wrapper" style="overflow: hidden;">
    <!-- Content Header (Page header) -->
    <section class="content-header">
      <h1>
        业务管理

      </h1>
      <ol class="breadcrumb">
        <li><a href="#"><i class="fa fa-dashboard"></i> 系统</a></li>
        <li class="active">业务管理</li>
      </ol>
    </section>

    <!-- Main content -->
    <section class="content">
      <div class="row">
        <div class="col-xs-12">
          <div class="box">
            <div class="box-header">
              <h3 class="box-title">业务列表</h3>
              <div class="box-toolss">
                <form method="post" action="{:url('business/search')}">
                <div class="input-group input-group-lg" style="width: 450px;">
                  <div class="col-sm-7"><input type="text" name="keywords" class="form-control pull-left" placeholder="Search"></div>
                  <div class="col-sm-3"><select name="sel" class="form-control pull-left">
                    <option value="0">编号</option>
                    <option value="1">单位</option>
                    <option value="2">电话</option>
                    <option value="3">类型</option>
                    <option value="4">区域</option>
                  </select></div>
                  <div class="col-sm-2"><div class="input-group-btn">
                    <button type="submit" class="btn btn-default"><i class="fa fa-search"></i></button>
                  </div></div>



                </div>
                </form>
              </div>
              <div class="box-tools">
                <div class="input-group input-group-sm" style="width: 150px;">
                  <a href = '{:url('business/add')}' class=" btn bg-olive margin">添加业务</a>

                  <div class="input-group-btn">

                  </div>
                </div>
              </div>
            </div>
            <!-- /.box-header -->
            <div class="box-body table-responsive no-padding ">
              <table class="table table-hover text-center">
                <tr>
                  <th>ID</th>
                  <th>编号</th>
                  <th>单位</th>
                  <th>电话</th>
                  <th>类型</th>
                  <th>区域</th>
                  <th>状态</th>
                  <th>日期</th>
                  <th>操作</th>
                </tr>
                {volist name="list" id="vo"}
                <tr>
                  <td>{$vo.bus_id}</td>
                  <td>{$vo.bus_no}</td>
                  <td><a class="show" data-id="{$vo.bus_id}" cate-id="{$vo.cate_name}" href="javascript:;">{$vo.bus_name}</a></td>
                  <td>{$vo.bus_tel}</td>
                  <td>{$vo.cate_name}</td>
                  <td>{$vo.area_name}</td>
                  <td><a href="#" {if condition="$vo['bus_status'] eq 5"}class="label label-success"{else}class="label label-danger"{/if}> {if condition="$vo['bus_status'] eq 5"}已办结{elseif condition="$vo['bus_status'] eq 0"}已退回{else}{$vo.bus_status}级审核{/if}</a></td>
                  <td>{$vo.bus_create_time|date="Y-m-d",###}</td>


                  <td><div>
                    <a class="edit" style="margin-right: 20px;"  href="{:url('business/edit',array('id'=>$vo['bus_id']))}" >
                      <i class="fa fa-pencil"></i>
                    </a>
                    <a class="del" data-id="{:url('business/del',array('id'=>$vo['bus_id']))}" href="javascript:;">
                      <i class="fa fa-trash-o"></i>
                    </a>
                  </div></td>
                </tr>
                {/volist}
              </table>
            </div>
            <div style="text-align:right;margin-top:10px;">
              {$list->render()}	                </div>
            <!-- /.box-body -->
          </div>
          <!-- /.box -->
        </div>
      </div>

    </section>
    <!-- /.content -->
  </div>
  <!-- /.content-wrapper -->

  <!-- 底部 -->
  {include file="common/footer"}
  <!-- /底部 -->
  <div id="showbox" style="display:none;">
    <table  class="table table-bordered table-hover dataTable" role="grid" aria-describedby="example2_info">
      <tbody>
      <tr role="row" class="even">
        <td style="width: 50%;"><label class="show_label">业务编号:</label><span  class="" id="no"  ></span></td>
        <td style="width: 50%;"><label class="show_label">申请单位:</label><span  class="" id="name"  ></span></td>
      </tr>
      <tr role="row" class="even">
        <td style="width: 50%;"><label class="show_label">业务类型:</label><span  class="" id="cate_id"  ></span></td>
        <td style="width: 50%;"><label class="show_label">联系电话:</label><span  class="" id="tel"  ></span></td>
      </tr>
      <tr role="row" class="even">
        <td style="width: 50%;"><label class="show_label">所属区域:</label><span  class="" id="area_id"  ></span></td>
        <td style="width: 50%;"><label class="show_label">详细地址:</label><span  class="" id="address"  ></span></td>
      </tr>
      </tbody>
    </table>
    <div id="content" class="show_content"></div>
    <div id="kanyan_show" class="show_kanyan text-center"></div>
    <div id="message_show">
      <table class="table table-hover text-center">
        <tbody>
        <tr id="til">
          <th>审核状态</th>
          <th>审核部门</th>
          <th>审核人员</th>
          <th>审核详情</th>
          <th>审核时间</th>
        </tr>
        <!--<tr>-->
        <!--<td></td>-->
        <!--<td></td>-->
        <!--<td></td>-->
        <!--<td></td>-->
        <!--</tr>-->
        </tbody></table>
    </div>
    
    <!-- /.box-footer -->
  </div>
  <!-- ./wrapper -->
  <script>

      // 显示业务详情
      $('.show').on('click', function(){

          $.ajax({
              url: "{:url('business/ajaxShow')}",
              type: 'POST',
              dataType: 'json',
              data: {
                  id:$(this).attr('data-id'),
                  cate_id:$(this).attr('cate-id')
              }
          })
              .done(function(res) {
                  console.log(res);
                  if(res.ECODE== 200){

                      $('#no').text(res.MSG.base.bus_no);
                      $('#name').text(res.MSG.base.bus_name);
                      $('#tel').text(res.MSG.base.bus_tel);
                      $('#cate_id').text(res.MSG.base.cate_name);
                      $('#area_id').text(res.MSG.base.area_name);
                      $('#address').text(res.MSG.base.bus_address);
                      $('#content').html(res.MSG.base.bus_content);
                      var kanyan_img="<img src='"+res.MSG.base.bus_thumb+"'>";
                      // $('#kanyan_show').afterAll().remove();
                      $('#kanyan_show').append(kanyan_img);
                      $('#pass').attr('pname-id',res.MSG.base.pos_name);
                      $('#pass').attr('status-id',res.MSG.base.bus_status);
                      $('#back').attr('pname-id',res.MSG.base.pos_name);
                      $('#pass').attr('data-id',res.MSG.base.bus_id);
                      $('#back').attr('status-id',res.MSG.base.bus_status);
                      $('#back').attr('data-id',res.MSG.base.bus_id);
                      $('#bakkanyan').attr('data-id',res.MSG.base.bus_id);
                      $('#bakkanyan').attr('status-id',res.MSG.base.bus_status);

                      var info = res.MSG.info;
                      var info_html = "";
                      if(info){
                          for(var i=0;i<info.length;i++){
                              var num=info[i].mstatus;
                              info_html += '<tr>';
                              info_html += num == 1 ? '<td><span class="label label-success">通过</span></td>' : '<td><span class="label label-danger">退回</span></td>';
                              info_html += '<td>'+ info[i].position_name +'</td>';
                              info_html += '<td>'+ info[i].name +'</td>';
                              info_html += '<td>'+ info[i].content +'</td>';
                              info_html += '<td>'+ info[i].create_time +'</td>';
                              info_html += '</tr>';
                          }
                      }
                      $('#til').nextAll().remove();
                      $('#til').after(info_html);

                      //页面层
                      layer.open({
                          type: 1,
                          title: '业务审核',
                          skin: 'layui-layer-rim', //加上边框
                          area: ['80%','80%'], //宽高
                          content: $('#showbox')
                      });
                  }

              });
      });







  </script>

  <!-- Bootstrap 3.3.7 -->
  <script src="__ADMIN__/bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
  <!-- Morris.js charts -->
  <script src="__ADMIN__/bower_components/raphael/raphael.min.js"></script>
  <script src="__ADMIN__/bower_components/morris.js/morris.min.js"></script>
  <!-- Sparkline -->
  <script src="__ADMIN__/bower_components/jquery-sparkline/dist/jquery.sparkline.min.js"></script>
  <!-- jvectormap -->
  <script src="__ADMIN__/plugins/jvectormap/jquery-jvectormap-1.2.2.min.js"></script>
  <script src="__ADMIN__/plugins/jvectormap/jquery-jvectormap-world-mill-en.js"></script>
  <!-- jQuery Knob Chart -->
  <script src="__ADMIN__/bower_components/jquery-knob/dist/jquery.knob.min.js"></script>
  <!-- daterangepicker -->
  <script src="__ADMIN__/bower_components/moment/min/moment.min.js"></script>
  <script src="__ADMIN__/bower_components/bootstrap-daterangepicker/daterangepicker.js"></script>
  <!-- datepicker -->
  <script src="__ADMIN__/bower_components/bootstrap-datepicker/dist/js/bootstrap-datepicker.min.js"></script>
  <!-- Bootstrap WYSIHTML5 -->
  <script src="__ADMIN__/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.min.js"></script>
  <!-- Slimscroll -->
  <script src="__ADMIN__/bower_components/jquery-slimscroll/jquery.slimscroll.min.js"></script>
  <!-- FastClick -->
  <script src="__ADMIN__/bower_components/fastclick/lib/fastclick.js"></script>
  <!-- AdminLTE App -->
  <script src="__ADMIN__/dist/js/adminlte.min.js"></script>
  <!-- AdminLTE dashboard demo (This is only for demo purposes) -->

  <!-- AdminLTE for demo purposes -->
  <script src="__ADMIN__/dist/js/demo.js"></script>
</body>
</html>
